import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { MaterialEverydayCensusVO, MaterialEverydayCensusForm, MaterialEverydayCensusQuery } from '@/api/oce/materialEverydayCensus/types';

/**
 * 查询巨量素材每日数据统计列表
 * @param query
 * @returns {*}
 */

export const listMaterialEverydayCensus = (query?: MaterialEverydayCensusQuery): AxiosPromise<MaterialEverydayCensusVO[]> => {
  return request({
    url: '/oce/materialEverydayCensus/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询巨量素材每日数据统计详细
 * @param id
 */
export const getMaterialEverydayCensus = (id: string | number): AxiosPromise<MaterialEverydayCensusVO> => {
  return request({
    url: '/oce/materialEverydayCensus/' + id,
    method: 'get'
  });
};

/**
 * 新增巨量素材每日数据统计
 * @param data
 */
export const addMaterialEverydayCensus = (data: MaterialEverydayCensusForm) => {
  return request({
    url: '/oce/materialEverydayCensus',
    method: 'post',
    data: data
  });
};

/**
 * 修改巨量素材每日数据统计
 * @param data
 */
export const updateMaterialEverydayCensus = (data: MaterialEverydayCensusForm) => {
  return request({
    url: '/oce/materialEverydayCensus',
    method: 'put',
    data: data
  });
};

/**
 * 删除巨量素材每日数据统计
 * @param id
 */
export const delMaterialEverydayCensus = (id: string | number | Array<string | number>) => {
  return request({
    url: '/oce/materialEverydayCensus/' + id,
    method: 'delete'
  });
};
